package me.bincker.formwork.web.modules.system.controller

import me.bincker.formwork.web.core.annotation.Permission
import me.bincker.formwork.web.core.security.MethodSecurityMetadataSource
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("permissions")
class PermissionController(
        private val methodSecurityMetadataSource: MethodSecurityMetadataSource
) {
    @GetMapping
    @Permission("获取权限列表", "permission.get")
    fun getAll() = methodSecurityMetadataSource.getAllPermission()
}